package programDetails;
/*
3. 重写和重载区别
    重写 Override
 */
public class _1_3_CompareOverloadOverRide {
    public static void main(String[] args) {
        Animal a=new Animal();
        Animal b=new Dog();
        Animal c=new Cat();
        a.move();
        b.move();

        c.move();
    }
}
class Animal{
    public void move(){
        System.out.println("动物可以移动");
    }
}
class Dog extends Animal{
    @Override
    public void move() {
        System.out.println("狗能跑和走");
    }
}
class Cat extends Animal{
    @Override
    public void move() {
        super.move();
        System.out.println("猫能跑和走~");
    }
}
/*

 */